package com.bubblegumproject.ogo.component;

import com.bubblegumproject.ogo.action.Context;

/**
 * A Container that knows how to create and manage a set of Components as well as provide additional component services.
 * 
 * @author Azubuko Obele (buko.obele@gmail.com)
 */
public interface Container {

    public <T> void register(Class<T> componentClazz);

    public boolean contains(Class componentClazz);

    /**
     * Create a new instance of a Component.
     *
     * @param targetClazz class of the Component to create or an interface or superclass
     * @param context     Context in which creation takes place, may be used for dependency injection purposes
     * @return            instance of an <strong>unstarted</strong> Component
     */
    public <T> T create(Class<T> targetClazz, Context context);

    public void destroy(Object component);

    public <T> ComponentProxy<T> getProxy(Class<T> componentClazz);

    public <T> ComponentProxy<T> getProxy(Object component);
    
}
